<template>
  <div>
    <img :src="pic_s444" alt />
    <ul>
      <li class="song-list" v-for="item in songlist" :key="item.index">
        <router-link :to="'/playsongs/' + item.song_id">
          <p>{{item.title}}</p>
          <p>{{item.author}}</p>
        </router-link>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  data() {
    return {
      pic_s444: "",
      songlist: []
    };
  },
  created() {
    this.getBillInfo();
  },
  methods: {
    getBillInfo() {
      const BillInfoUrl =
        this.HOST +
        "/v1/restserver/ting?method=baidu.ting.billboard.billList&type=" +
        this.$route.params.type;
      this.$axios
        .get(BillInfoUrl)
        .then(res => {
          this.pic_s444 = res.data.billboard.pic_s444;
          this.songlist = res.data.song_list;
        })
        .catch();
    }
  }
};
</script>
<style scoped>
.song-list {
  padding: 4px 10px;
  border-bottom: 1px solid #cccccc;
  background: #ffffff;
}
.song-list p:nth-of-type(1) {
  color: #000 !important;
  font-size: 15px;
}
.song-list p:nth-of-type(2) {
  font-size: 13px;
}
</style>